
head = [3, 2, 0, -4], pos = 1

var detectCycle = function (head) {
    let fast = new ListNode()
    let slow = new ListNode()
    fast = head
    slow = head
    while (fast && fast.next) {
        fast = fast.next.next
        slow = slow.next
        if (slow === fast) {
            let index1 = new ListNode()
            let index2 = new ListNode()
            index1 = fast
            index2 = head
            while (index1 !== index2) {
                index1 = index1.next
                index2 = index2.next
            }
            return index1.next
        }

    }
    return null
};